package cn.edu.ctbu.demo1.service;
import cn.edu.ctbu.demo1.domain.Student;
import org.springframework.data.domain.Example;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public interface StudentService {



    List<Student> findAll();

    /**
     * 只支持分页的查询
     * @param pageable
     * @return
     */
    Page<Student> findAll(Pageable pageable);

    /**
     *
     * @param
     * @return
     */
    public Page<Student> findAll(Example<Student> student,Pageable pageable);
    List<Student> findAll(Example<Student> example);
    /**
    *按id进行查询
    * @param id 主键，整数
     * @return
    */
    Student findById(Integer id);

    /**
     *按姓名进行查询 ,like
     * @param name 主键，整数
     * @return
     */
    List<Student> findByName(String name);
//    /**
//     *按姓名和密码进行查询 ,like
//     * @param name
//     * @param password
//     * @return
//     */
//     Student findByNameAndPassword(String name,String password);
    List<Student> findByNameAndPassword(String name,String password);
    List<Student> findByNoAndPassword(String no,String password);
//    Student findByNameAndPassword(String name,String password) throws Exception;

    Student insert(Student student);
    Student update(Student student);

    void delete(Integer id);

}
